<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Graphics</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="edit68k.css" rel="stylesheet" type="text/css">
</head>

<body class="text">
<p class="heading">Sim68K Graphics<br><hr noshade></p>
<p></p>
<p>TRAP #15 is used for I/O. &nbsp;Put the task number in D0.</p>
<p> The output screen resolution is adjustable via Task 33. The top 
left corner of the window is position 0,0<br>
 Drawing outside the screen area is ignored.<br>
 The screen may be cleared with task 11.</p>
<b>&nbsp;Task</b>
<table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="697">
  <tr>
    <td width="6%" class="text">
	<p><b>&nbsp;80</b></td>
    <td width="94%" class="text">
      <p>
		&nbsp;Set pen color where D1.L is color as $00BBGGRR<br>
&nbsp;&nbsp;&nbsp;&nbsp;BB is amount of blue from $00 to $FF
      <br>
		&nbsp;&nbsp;&nbsp;&nbsp;GG is amount of green from 
		$00 to $FF<br>
&nbsp;&nbsp;&nbsp;&nbsp;RR is amount of red from $00 to $FF</td>
  </tr>
  <tr>
    <td width="6%" class="text">
	<p><b>&nbsp;81</b></td>
    <td width="94%" class="text">
	<p>&nbsp;Set fill color where D1.L is color as 
	$00BBGGRR</td>
  </tr>
  <tr>
    <td width="6%" class="text">
	<p><b>&nbsp;82</b></td>
    <td width="94%" class="text">
	<p>
	&nbsp;Draw pixel in pen color at X,Y where X = D1.W &amp; Y = D2.W <br>
		&nbsp;&nbsp;&nbsp; The drawing mode (see 92 below) is not used.</td>
  </tr>
  <tr>
    <td width="6%" class="text">
	<p><b>&nbsp;83</b></td>
    <td width="94%" class="text">
	<p>&nbsp;Get pixel color at X,Y and place in D0.L where X = D1.W &amp; Y = D2.W.</td>
  </tr>
  <tr>
    <td width="6%" class="text">
	<p><b>&nbsp;84</b></td>
    <td width="94%" class="text">
	<p>&nbsp;Draw line using pen color from X1,Y1 to X2,Y2<br>
&nbsp;&nbsp;&nbsp; where X1 = D1.W, Y1 = D2.W, X2 = D3.W, Y2 = D4.W</td>
  </tr>
  <tr>
    <td width="6%" class="text">
	<p><b>&nbsp;85</b></td>
    <td width="94%" class="text">
	<p>&nbsp;Draw line using pen color to X,Y where X = D1.W &amp; Y = D2.W</td>
  </tr>
  <tr>
    <td width="6%" class="text">
	<p><b>&nbsp;86</b></td>
    <td width="94%" class="text">
	<p>&nbsp;Move to X,Y where X = D1.W &amp; Y = D2.W</td>
  </tr>
  <tr>
    <td width="6%" class="text">
	<p><b>&nbsp;87</b></td>
    <td width="94%" class="text">
	<p> 
	&nbsp;Draw rectangle defined by (Left X, Upper Y, Right X, Lower Y).&nbsp;
        <br>
		&nbsp;&nbsp;&nbsp; where LX = D1.W, UY = D2.W, RX = D3.W, LY = D4.W <br>
		&nbsp;&nbsp;&nbsp; The rectangle is drawn using pen color and filled using fill color.</td>
  </tr>
  <tr>
    <td width="6%" class="text">
	<p><b>&nbsp;88</b></td>
    <td width="94%" class="text">
	<p>
	&nbsp;Draw ellipse bounded by the rectangle (Left X, Upper Y, Right X, Lower Y)
        <br>
		&nbsp;&nbsp;&nbsp; where LX = D1.W, UY = D2.W, RX = D3.W, LY = D4.W <br>
		&nbsp;&nbsp;&nbsp; The ellipse is drawn using pen color and filled using fill color.
      <br>
		&nbsp;&nbsp;&nbsp; A circle is drawn if the bounding rectangle is a square.</td>
  </tr>
  <tr>
    <td width="6%" class="text">
	<p><b>&nbsp;89</b></td>
    <td width="94%" class="text">
	<p>&nbsp;Flood Fill the area at X, Y with the fill color where X = D1.W &amp; Y = D2.W</td>
  </tr>
  <tr>
    <td width="6%" class="text">
	<p><b>&nbsp;90</b></td>
    <td width="94%" class="text">
	<p>&nbsp;Draw unfilled rectangle defined by (Left X, Upper Y, Right X, Lower Y).&nbsp;<br>
&nbsp;&nbsp;&nbsp; where LX = D1.W, UY = D2.W, RX = D3.W, LY = D4.W<br>
&nbsp;&nbsp;&nbsp; The rectangle is drawn using pen color and is not filled.</td>
  </tr>
  <tr>
    <td width="6%" class="text">
	<p><b>&nbsp;91</b></td>
    <td width="94%" class="text">
	<p>&nbsp;Draw unfilled ellipse bounded by the rectangle (Left X, Upper Y, Right X, Lower Y)<br>
&nbsp;&nbsp;&nbsp; where LX = D1.W, UY = D2.W, RX = D3.W, LY = D4.W<br>
&nbsp;&nbsp;&nbsp; The ellipse is drawn using pen color and is not filled.<br>
&nbsp;&nbsp;&nbsp; A circle is drawn if the bounding rectangle is a square.</td>
  </tr>
  <tr>
    <td width="6%" class="text">
	<p><b>&nbsp;92</b></td>
    <td width="94%" class="text">
	<p>&nbsp;Set drawing mode 
	which affects pen and fill colors. D1.B is mode number as:<br>
&nbsp;&nbsp;&nbsp; 0 - Draw color is always black, ignores pen and fill colors<br>
&nbsp;&nbsp;&nbsp; 1 - Draw color is always white, ignores pen and fill colors<br>
&nbsp;&nbsp;&nbsp; 2 - Move cursor but do not draw<br>
&nbsp;&nbsp;&nbsp; 3 - NOT (background color) is drawn<br>
&nbsp;&nbsp;&nbsp; 4 - The draw color is drawn (default)<br>
&nbsp;&nbsp;&nbsp; 5 - NOT (draw color) is drawn<br>
&nbsp;&nbsp;&nbsp; 6 - NOT (background color) OR (draw color) is drawn<br>
&nbsp;&nbsp;&nbsp; 7 - NOT (background color) AND (draw color) is drawn<br>
&nbsp;&nbsp;&nbsp; 8 - (background color) OR NOT (draw color) is drawn<br>
&nbsp;&nbsp;&nbsp; 9 - (background color) AND NOT (draw color) is drawn<br>
&nbsp; 10 - (background color) OR (draw color) is drawn<br>
&nbsp; 11 - (background color) NOR (draw color) is drawn<br>
&nbsp; 12 - (background color) AND (draw color) is drawn<br>
&nbsp; 13 - (background color) NOT AND (draw color) is drawn<br>
&nbsp; 14 - (background color) XOR (draw color) is drawn<br>
&nbsp; 15 - (background color) NOT XOR (draw color) is drawn|<br>
	&nbsp; 16 - 
	Turn off double buffering (default)<br>
	&nbsp; 17 - 
	Enable double buffering. Draw on off screen buffer<br>
	* The background color is whatever is already there.<br>
	* The draw color is the pen color or the fill color.</td>
  </tr>
  <tr>
    <td width="6%" class="text">
	<p><b>&nbsp;93</b></td>
    <td width="94%" class="text">
	<p>&nbsp;Set pen width where D1.B is width in pixels.</td>
  </tr>
	<tr>
    <td width="6%" class="text">
	<p><b>&nbsp;94</b></td>
    <td width="94%" class="text">
	<p>&nbsp;Repaint 
	screen. Copies off screen buffer to visible screen.<br>
	&nbsp;(Requires drawing mode 17 be set from task 92 
	above.)</td>
  </tr>
	<tr>
    <td width="6%" class="text">
	<p><b>&nbsp;95</b></td>
    <td width="94%" class="text">
	<p>&nbsp;Draw the NULL terminated 
	string of text at (A1) to screen location X,Y where X = D1.W &amp; Y = D2.W. <br>
&nbsp;The text is drawn as graphics and may not be read using trap task 22. 
	Control characters are ignored.<br>
&nbsp;X,Y specifies the location of the top left corner of the text.</td>
  </tr>
</table>
<p> <br>
<b>Some color values:</b><table border="0" width="29%" class="sourcecode">
  <tr>
    <td width="25%" class="sourcecode">BLACK</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$00000000</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode">MAROON</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$00000080</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode">GREEN</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$00008000</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode">OLIVE</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$00008080</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode">NAVY</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$00800000</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode">PURPLE</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$00800080</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode">TEAL</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$00808000</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode">GRAY</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$00808080</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode">RED</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$000000FF</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode" height="20">LIME</td>
    <td width="24%" class="sourcecode" height="20">equ</td>
    <td width="57%" class="sourcecode" height="20">$0000FF00</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode">YELLOW</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$0000FFFF</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode">BLUE</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$00FF0000</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode">FUCHSIA</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$00FF00FF</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode">AQUA</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$00FFFF00</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode">LTGRAY</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$00C0C0C0</td>
  </tr>
  <tr>
    <td width="25%" class="sourcecode">WHITE</td>
    <td width="24%" class="sourcecode">equ</td>
    <td width="57%" class="sourcecode">$00FFFFFF</td>
  </tr>
</table>
</body>
</html>
